package com.shiguiwu.springboot3.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

/**
 * @description: 历史聊天消息
 * @author: stone
 * @date: Created by 2025/10/19 21:49
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springboot3.entity
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "chat_message")
public class ChatMessage {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private Long sessionId;

    private String content;

    private Long toUserId;

    private Long fromUserId;

    private LocalDateTime createdAt;

    private LocalDateTime updatedAt;

    @Column(name = "is_read", nullable = false)
    private Byte isRead;

    private String attachments;


}
